package common;

/**
 * @author Or Kaplan
 *
 * A reporter implementation that just count any type of report
 */
public class SimpleReporter implements IReporter {
	private int info = 0, warnings = 0, error = 0, fatal = 0;
	
	
	/* (non-Javadoc)
	 * @see common.IReporter#GenerateReport()
	 */
	@Override
	public String GenerateReport() {
		return String.format("=============\nInfo:\t\t%d\nWarnings:\t%d\nErrors:\t\t%d\nFatal:\t\t%d", info, warnings, error, fatal);
	}

	/* (non-Javadoc)
	 * @see common.IReporter#ReportError(java.lang.String)
	 */
	@Override
	public void ReportError(String message) {
		error++;
	}

	/* (non-Javadoc)
	 * @see common.IReporter#ReportFatal(java.lang.String)
	 */
	@Override
	public void ReportFatal(String message) {
		fatal++;
	}

	/* (non-Javadoc)
	 * @see common.IReporter#ReportInfo(java.lang.String)
	 */
	@Override
	public void ReportInfo(String message) {
		info++;
	}

	/* (non-Javadoc)
	 * @see common.IReporter#ReportWarning(java.lang.String)
	 */
	@Override
	public void ReportWarning(String message) {
		warnings++;
	}

}
